<template>
  <div class="box" ref="Bar"></div>
</template>

<script>
import * as echarts from "echarts";
export default {
  name: "BarCharts",
  mounted() {
    // 创建echarts实例
    let BarCharts = echarts.init(this.$refs.Bar);
    // 配置数据
    BarCharts.setOption({
      xAxis: {
        show: false,
        type: "category",
      },
      yAxis: {
        show: false,
      },
      // 系列
      series: [
        {
          type: "bar",
          data: [10, 5, 7, 14, 4, 8, 11, 18, 19, 17],
          color: "skyblue",
        },
      ],
      // 布局
      grid: {
        letf: 0,
        top: 0,
        right: 20,
        bottom: 0,
      },
    });
  },
};
</script>

<style>
.box {
  width: 100%;
  height: 100%;
}
</style>